home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
Source
/
tarsrc Folder
/
tape.h
< prev
next >
Wrap
Text File
|
1993-11-27
|
2KB
|
102 lines
/*
* Generic SCSI tape driver
*/
#define OP_READY 0x00 /* test unit ready */
#define OP_REWIND 0x01 /* rewind */
#define OP_ERAALT 0x02 /* erase (alternate) */
#define OP_SENSE 0x03 /* request sense */
#define OP_RBL 0x05 /* read block limits */
#define OP_RAS 0x06 /* request auxiliary sense */
#define OP_READ 0x08 /* read */
#define OP_WRITE 0x0a /* write */
#define OP_WFM 0x10 /* write file marks */
#define OP_SPACE 0x11 /* space */
#define OP_INQUIRY 0x12 /* inquiry */
#define OP_RBD 0x14 /* read buffered data */
#define OP_MODESELECT 0x15 /* mode select */
#define OP_RESERVE 0x16 /* reserve unit */
#define OP_RELEASE 0x17 /* release unit */
#define OP_ERASE 0x19 /* erase */
#define OP_MODESENSE 0x1a /* mode sense */
#define OP_PREWIND 0x1b /* prewind */
#define OP_LOCK 0x1e /* lock cassette (light LED) */
#define S_NOSENSE 0x0
#define S_NOTREADY 0x2
#define S_MEDERROR 0x3
#define S_HDERROR 0x4
#define S_ILLREQ 0x5
#define S_UNITATTN 0x6
#define S_DATAPROTECT 0x7
#define S_NODATA 0x8
#define S_ABORTED 0xb
#define S_VOLOVER 0xd
#define IMMEDIATE 1
#define WAIT 0
#define FIXED 1
#define VARIABLE 0
#define BLOCKS 0
#define FILEMARKS 1
#define SEQFM 2 /* sequential file marks */
#define EOD 3 /* physical end of data */
typedef struct {
Byte valid:1;
Byte class:3;
Byte code:4;
Byte segment;
Byte fmk:1;
Byte eom:1;
Byte ili:1;
Byte rsvd0:1;
Byte key:4;
Byte info[4];
Byte asl;
Byte csi[4];
Byte asc;
Byte ascq;
Byte fruc;
Byte sks[3];
} Sense;
typedef struct {
Byte type;
Byte rmb:1;
Byte qualifier:7;
Byte isov:2;
Byte ecmav:3;
Byte ansiv:3;
Byte rsvd1;
Byte al;
Byte rsvd2[3];
Byte vendor[8];
Byte product[16];
Byte revision[4];
} Inquiry;
typedef struct {
Byte mdl;
Byte mediumType;
Byte wp:1;
Byte bufMode:3;
Byte speed:4;
Byte bdl;
Byte densityCode;
Byte numBlocks[3];
Byte :8;
Byte blockLen[3];
} ModeData;
typedef struct {
Byte :8;
Byte maxBL[3];
Byte minBL[2];
} RBLData;
#define BYTES4_INT(x) (((x)[0] << 24) | ((x)[1] << 16) | ((x)[2] << 8) | (x)[3])
#define BYTES3_INT(x) (((x)[0] << 16) | ((x)[1] << 8) | (x)[2])
#define BYTES2_INT(x) (((x)[0] << 8) | (x)[1])